
/*
消息类型定义
*/

#ifndef __MESSAGE_DEFINE_H__
#define __MESSAGE_DEFINE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>
#include <stdint.h>

//消息地址类型
typedef uint8_t MsgBusAddr_T;
enum {
	MsgBusAddr_Cmd,
	MsgBusAddr_Uart,
	MsgBusAddr_Hid,
	MsgBusAddr_MAX
};

//消息属性
typedef uint8_t MsgAttr_T;

//消息类型
typedef uint8_t MsgType_T;
enum {
	MsgType_Card,
	MsgType_Uart,
	MsgType_Hid,
	MsgType_MAX
};


//消息
typedef struct{
	MsgBusAddr_T dest;
	MsgBusAddr_T src;
	MsgType_T type;
	MsgAttr_T attr;
	union {
		void * data;
		uint32_t val;
	};
}Message_T;

//消息处理接口
typedef int (*MsgHandler_T)(Message_T*);

#ifdef __cplusplus
}
#endif

#endif



